proclist = [[{'AS110207M01'}, {'2011-02-09'}]' [{'AS110207M01'}, {'2011-02-17'}]']';


nblocks = size(proclist,1);

neurons = cell(nblocks,1);
odmeans = cell(nblocks,1);
odmaxs = cell(nblocks,1);

for n=1:nblocks
    animal = proclist{n,1};
    date = proclist{n,2};
    foundcells = findcells(animal, date, '', 0);
    for i=1:length(foundcells(:,3))
        foundcells{i,3} = sscanf(foundcells{i,3}','R%02u');
    end
    unineurons = unique(cell2mat(foundcells(:,3:4)),'rows');
    nn = size(unineurons,1);
    odmean = NaN(nn,1);
    odmax =  NaN(nn,1);
    for i=1:nn
        [~,neuronra] = getra(animal, date, num2str(unineurons(i,1),'R%02u'), unineurons(i,2));
        if length(neuronra) > 0
            odmean(i) = od(ramean(neuronra));
            odmax(i) = od(ramax(neuronra));
        else
            disp(['Problem: ' date  ' ' num2str(unineurons(i,1),'R%02u') ' ' num2str(unineurons(i,2))])
        end
    end
    neurons{n} = unineurons;
    odmeans{n} = odmean;
    odmaxs{n} = odmax;
end

